using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

public partial class Controls_Access : System.Web.UI.UserControl
{
    private string _message = "Access code required.";
    public string Message
    {
        get { return _message; }
        set { _message = value; }
    }
    private string _id = "-1";
    public string UserId
    {
        get { return _id; }
        set { _id = value; }
    }
    public Controls_Access()
    {
        this.PreRender += new EventHandler(Controls_Access_PreRender);
    }

    void Controls_Access_PreRender(object sender, EventArgs e)
    {
        lblMessage.Text = Common.GetErrorText(_message);
        lblCode.Text = ResourceHelper.Get("LBL_EnterCode");
        lblAccess.Text = ResourceHelper.Get("LBL_Access");
        lblSend.Text = "<div style=\"float:right;\">" + Common.GetImageTextLink("SendMessage.aspx?id=" + _id, "Images/dj/mail.gif", ResourceHelper.Get("MSG_RequestOrg"), 20) + "</div>";
        btnSubmit.Attributes.Add("onmouseover", "this.src='Images/dj/goh.gif'");
        btnSubmit.Attributes.Add("onmouseout", "this.src='Images/dj/go.gif'");
    }
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnGo_Click(object sender, ImageClickEventArgs e)
    {
        Dictionary<string, string> kvList = new Dictionary<string, string>();
        kvList.Add("c", txtCode.Text);
        string path = Common.ResetUrl(kvList);
        Response.Redirect(path);
    }
}
